<?php
/**
 * 全局底部调用
 */
?>
    <footer class="footer">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6">
                    2019 - 2022 © All rights reserved - <?php echo $conf['sitename'] ?>
                </div>
                <div class="col-md-6">
                    <div class="text-md-right footer-links d-none d-md-block">
                        <a href="<?php echo $conf['Communication'] ?>" target="_blank">官方交流群</a>
                        <a href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $admin_qq ?>&site=qq&menu=yes" target="_blank">联系客服</a>
                    </div>
                </div>
            </div>
        </div>
    </footer>
<script src="../assets/js/app.min.js"></script>
<script src="../assets/js/vendor/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../assets/js/vendor/jquery-jvectormap-world-mill-en.js"></script>
<script src="../assets/layui/layui.all.js"></script>
<script src="../assets/js/vue.js"></script>
<script>
$(document).ready(function(){
    $.ajax({
        type : "GET",
        url : "ajax.php?act=count",
        dataType : 'json',
        async: true,
        success : function(data) {
            if(data.code==0){
                if(data.count>0){
                    toastr.info('<a href="tixian.php">授权平台共有<b>'+data.count+'</b>条提现申请，请赶快处理！</a>', '提现提醒');
                }
                if(data.count2>0){
                    toastr.warning('<a href="workorder.php">授权平台共有<b>'+data.count2+'</b>个工单还未处理哦！</a>', '工单提醒');
                }
            }
        }
    });
});
function optim(){
    var confirmobj = layer.confirm('你确实要该操作吗？', {
      icon: 3, btn: ['确定','取消']
    }, function(){
      var ii = layer.msg('正在优化中,请稍后...', {icon: 16, time: 10 * 1000});
      $.ajax({
          type : 'POST',
          url : 'ajax.php?act=optim',
          dataType : 'json',
          success : function(data) {
              layer.close(ii);
              if(data.code == 0){
                  layer.msg(data.msg, {icon: 6});
              }else{
                  layer.msg(data.msg, {icon: 5})
              }
          },
          error:function(data){
              layer.msg('服务器错误', {icon: 5});
              return false;
          }
      });
    });
    return false;
}
function repair(){
    var confirmobj = layer.confirm('你确实要该操作吗？', {
      icon: 3, btn: ['确定','取消']
    }, function(){
      var ii = layer.msg('正在修复中,请稍后...', {icon: 16, time: 10 * 1000});
      $.ajax({
          type : 'POST',
          url : 'ajax.php?act=repair',
          dataType : 'json',
          success : function(data) {
              layer.close(ii);
              if(data.code == 0){
                  layer.msg(data.msg, {icon: 6});
              }else{
                  layer.msg(data.msg, {icon: 5})
              }
          },
          error:function(data){
              layer.msg('服务器错误', {icon: 5});
              return false;
          }
      });
    });
    return false;
}
function cleanbom() {
    var confirmobj = layer.confirm('你确实要该操作吗？', {
      icon: 3, btn: ['确定','取消']
    }, function(){
      $.ajax({
        type : 'GET',
        url : 'ajax.php?act=cleanbom',
        dataType : 'json',
        success : function(data) {
            if(data.code == 0){
                layer.msg(data.msg, {
                    icon: 6,
                    end: function (layero, index) {
                        window.location.reload();
                    }
                });
            } else {
                layer.msg(data.msg, {icon: 5});
            }
        },
        error:function(data){
            layer.msg('服务器错误', {icon: 5});
            return false;
        }
      });
    }, function(){
      layer.close(confirmobj);
    });
}
function downfile() {
    var body='<div class="form-group"><select class="form-control" id="proid"><option value="0">请选择程序</option><?php echo $select;?></select></div><input type="text" id="qq" placeholder="请输入QQ" class="form-control">';
    layer.confirm(body,{title:"下载源码",btn: ['确定','取消']}, function(){
        var proid=$("#proid").val();
        var qq=$("#qq").val();
        if (qq.length < 5 || qq.length > 10 || isNaN(qq)) {
            layer.msg('请输入5~10位QQ账号', {icon: 5});
            return false;
        }
        var ii = layer.msg('正在获取源码中,请稍后...', {icon: 16, time: 10 * 1000});
        $.ajax({
            type : 'POST',
            url : 'ajax.php?act=downfile',
            data : {proid:proid,qq:qq},
            dataType : 'json',
            success : function(data) {
                layer.close(ii);
                if(data.code == 0){
                    var confirmobj = layer.confirm('下载程序：'+data.name+'<br/>当前下载的是QQ:'+data.qq+'的源码<br/>授权码：'+data.authcode+'<br/>特征码：'+data.sign+'<hr/><b>提示：</b><br/>1.以上链接10分钟内有效<br/>2.如果需要全新搭建或之前未搭建过，请下载完整安装包；如果之前搭建过，请下载更新包直接覆盖。<br/>3.<b>同一个QQ的源码是相同的，无需重复下载</b>；不同QQ对应的源码是不一样的，请勿混用，否则会无法进入后台。', {
                        btn: ['安装包','更新包','取消']
                    }, function(){
                        window.location.href=data.installer;
                    }, function(){
                        window.location.href=data.updater;
                    }, function(){
                        layer.close(confirmobj);
                    });
                }else{
                    layer.msg(data.msg, {icon:5});
                }
            },
            error:function(data){
                layer.msg('服务器错误', {icon:5});
                return false;
            }
        });
    });
}
</script>